package com.insuremonitor.system.service.impl;

import com.insuremonitor.common.utils.DateUtils;
import com.insuremonitor.system.domain.FrontWarrantyCustomer;
import com.insuremonitor.system.mapper.FrontWarrantyCustomerMapper;
import com.insuremonitor.system.service.IFrontWarrantyCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 有意向保险客户Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-22
 */
@Service
public class FrontWarrantyCustomerServiceImpl implements IFrontWarrantyCustomerService 
{
    @Autowired
    private FrontWarrantyCustomerMapper frontWarrantyCustomerMapper;

    /**
     * 查询有意向保险客户
     * 
     * @param arrantyCustomerId 有意向保险客户主键
     * @return 有意向保险客户
     */
    @Override
    public FrontWarrantyCustomer selectFrontWarrantyCustomerByArrantyCustomerId(Long arrantyCustomerId)
    {
        return frontWarrantyCustomerMapper.selectByArrantyCustomerId(arrantyCustomerId);
    }

    /**
     * 查询有意向保险客户列表
     * 
     * @param frontWarrantyCustomer 有意向保险客户
     * @return 有意向保险客户
     */
    @Override
    public List<FrontWarrantyCustomer> selectFrontWarrantyCustomerList(FrontWarrantyCustomer frontWarrantyCustomer)
    {
        frontWarrantyCustomer.setStatus("1");
        return frontWarrantyCustomerMapper.selectList(frontWarrantyCustomer);
    }

    /**
     * 新增有意向保险客户
     * 
     * @param frontWarrantyCustomer 有意向保险客户
     * @return 结果
     */
    @Override
    public int insertFrontWarrantyCustomer(FrontWarrantyCustomer frontWarrantyCustomer)
    {
        frontWarrantyCustomer.setCreateTime(DateUtils.getNowDate());
        return frontWarrantyCustomerMapper.insertFrontWarrantyCustomer(frontWarrantyCustomer);
    }

    /**
     * 修改有意向保险客户
     * 
     * @param frontWarrantyCustomer 有意向保险客户
     * @return 结果
     */
    @Override
    public int updateFrontWarrantyCustomer(FrontWarrantyCustomer frontWarrantyCustomer)
    {
        frontWarrantyCustomer.setUpdateTime(DateUtils.getNowDate());
        return frontWarrantyCustomerMapper.updateFrontWarrantyCustomer(frontWarrantyCustomer);
    }

    /**
     * 批量删除有意向保险客户
     * 
     * @param arrantyCustomerIds 需要删除的有意向保险客户主键
     * @return 结果
     */
    @Override
    public int deleteFrontWarrantyCustomerByArrantyCustomerIds(Long[] arrantyCustomerIds)
    {
        return frontWarrantyCustomerMapper.deleteFrontWarrantyCustomerByArrantyCustomerIds(arrantyCustomerIds);
    }

    /**
     * 删除有意向保险客户信息
     * 
     * @param arrantyCustomerId 有意向保险客户主键
     * @return 结果
     */
    @Override
    public int deleteFrontWarrantyCustomerByArrantyCustomerId(Long arrantyCustomerId)
    {
        return frontWarrantyCustomerMapper.deleteFrontWarrantyCustomerByArrantyCustomerId(arrantyCustomerId);
    }
}
